UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rHJwg5Ne0XgZ/OpMdTCdb4f6mUpD4GYgpP8aBgvV3MI=' 
WHERE 
  key_id = '389b5df0e135db76ce6915b99c7fa6a9dffcc92d2106ab50e97fe34a45e91aac' 
  AND (
    token = 'rHJwg5Ne0XgZ/OpMdTCdb4f6mUpD4GYgpP8aBgvV3MI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031