UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'c8IfUNPSXQlllgjbk/ygZNSi1oo/sEQFXGiXXIjNPIc=' 
WHERE 
  key_id = 'a28e4ece1c6fbc693441e04a7f79417437a3b8117376a9cf845506dc09c4b205' 
  AND (
    token = 'c8IfUNPSXQlllgjbk/ygZNSi1oo/sEQFXGiXXIjNPIc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045