UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uaQ9aRZvuumFyDdWD95Mo69/FKBqds/1ENPXZcaa3pc=' 
WHERE 
  key_id = '55aa198ac2cb190a25088e789364d227668ff4e6cc347c989f59f0c8cbb8a2db' 
  AND (
    token = 'uaQ9aRZvuumFyDdWD95Mo69/FKBqds/1ENPXZcaa3pc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035