UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'i49RxRUPbNChXPouLrvpS1n/tbytb1mBJcLQKwlyu+Y=' 
WHERE 
  key_id = '02bac4257b7c465d1b90d7c050f7a7f2c5d0ba49926d7c637062c66df7a3e63f' 
  AND (
    token = 'i49RxRUPbNChXPouLrvpS1n/tbytb1mBJcLQKwlyu+Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033