UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PLBVvQmEojmRrsR6DF+BxtZZNfk7GVOArIkyebceBmQ=' 
WHERE 
  key_id = '1e061f03ae350b30efebe1c1bcf5a1cfb72a5b16b0fab39d86ba045efa2cc4f7' 
  AND (
    token = 'PLBVvQmEojmRrsR6DF+BxtZZNfk7GVOArIkyebceBmQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020