UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EVty53ZFnlqk5+TN90EcbVZGGilR7vT71ZCtj6p/ve4=' 
WHERE 
  key_id = 'bc96101d56614ec3038cef81a27fe5d6fb44db61517ed7bc6b3ac08366a4ac5d' 
  AND (
    token = 'EVty53ZFnlqk5+TN90EcbVZGGilR7vT71ZCtj6p/ve4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048