UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PVUmnOfxpDk7tkyBesZTVpsqKdT6D9XqwpOH6SyVaAA=' 
WHERE 
  key_id = 'bb528772f3595d19bff78330284f7aaebec5a03a3de1f589975a6aed59514f8a' 
  AND (
    token = 'PVUmnOfxpDk7tkyBesZTVpsqKdT6D9XqwpOH6SyVaAA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048