UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Pf7/TwwoHxUtNa954GOzIQcNK17ZeU8WUR/EzF6Kzuo=' 
WHERE 
  key_id = '20e77feaae00240c52eba222397982c53310abfdf102c3dea6fc54ef70675c6a' 
  AND (
    token = 'Pf7/TwwoHxUtNa954GOzIQcNK17ZeU8WUR/EzF6Kzuo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021