UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hlk79nQj8LBAetRNwdBqd/Ef/u8RkA//d8s6trXGqFs=' 
WHERE 
  key_id = 'efc4f3eeb742803a8d1db996b51b0a19a0f51ea45408b6bb82d00be95d372b61' 
  AND (
    token = 'hlk79nQj8LBAetRNwdBqd/Ef/u8RkA//d8s6trXGqFs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032