UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'G1d/93Ai/Y4AGKApCFeLMj9aNAaMDPHqGfVm7nAaYpY=' 
WHERE 
  key_id = 'cb5cc48f0d22edffe52984bb4272bb437119efc60c7061bf3fe0d7cccda8d293' 
  AND (
    token = 'G1d/93Ai/Y4AGKApCFeLMj9aNAaMDPHqGfVm7nAaYpY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032