UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4nR+cPpwmW9Jp93MFdjIkqJH8kKPMxMj92AyGd/ZUlw=' 
WHERE 
  key_id = '5979eb0fd774ef1cf7b39dac0e6ce6e067e7f81307edd1e968bbfd6b704ef24f' 
  AND (
    token = '4nR+cPpwmW9Jp93MFdjIkqJH8kKPMxMj92AyGd/ZUlw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027