UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iCTAAtUmvIgvF/3hSnpLfT2moHpLRpamNWDmLSQAKAA=' 
WHERE 
  key_id = '7adb5c74a8547040022eccd2c68df6c7faf24d5d5aa6c0f00f2129bd8d4d95a5' 
  AND (
    token = 'iCTAAtUmvIgvF/3hSnpLfT2moHpLRpamNWDmLSQAKAA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045