UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '67u5TFjaphjXcoljQQCbgIvZ4iCWU+i6yE9dpyIJ6rI=' 
WHERE 
  key_id = '5ad47d6b93a6bcd0a6b0384e3e4e932d8537eef960ff9d4510c026a5e7ddc7d7' 
  AND (
    token = '67u5TFjaphjXcoljQQCbgIvZ4iCWU+i6yE9dpyIJ6rI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038