UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1faf0TDKs9YMKvz/LEYz2N2ef0uQrw4RdSOAk+rp5ps=' 
WHERE 
  key_id = '7495ffc045204ca2e5362f4ab2c416c27734fc4a80a0083f3a4b505a7d14af3c' 
  AND (
    token = '1faf0TDKs9YMKvz/LEYz2N2ef0uQrw4RdSOAk+rp5ps=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024