UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dX8+1vW0T5WPedzB/tI6KoYFhLDWZ8eQrOHdLDYh060=' 
WHERE 
  key_id = '0591a651f130c723966ce1a573759f69ef301c15ad2f70ae875b6cc3ef441cd4' 
  AND (
    token = 'dX8+1vW0T5WPedzB/tI6KoYFhLDWZ8eQrOHdLDYh060=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00158