UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4k53IMfntYRFgGJxxZ8I7l7orXIC84DfiJyf9Lchyag=' 
WHERE 
  key_id = '5a8b5589189206d0811855e532eb3faaa277c08736fd0786db7fe2e1bcca4754' 
  AND (
    token = '4k53IMfntYRFgGJxxZ8I7l7orXIC84DfiJyf9Lchyag=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022