UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/iVPV+LLRiOWF+v1T88nBnWEL2Wj0kcyh8Jh/NesV5s=' 
WHERE 
  key_id = 'f038c9ca384e27ee324ff0f8b1804d0db32b08d8866f8a4e3e7c0e26200d62f3' 
  AND (
    token = '/iVPV+LLRiOWF+v1T88nBnWEL2Wj0kcyh8Jh/NesV5s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029