UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LHPIXttToyjSS47OqYSpSIp0nZJhB2d4yRGfnSUQjOk=' 
WHERE 
  key_id = '6ac786ceff0cc2bb7f9d744d9e9391b8a6c92164af0cafd0fe902da20af7b6a0' 
  AND (
    token = 'LHPIXttToyjSS47OqYSpSIp0nZJhB2d4yRGfnSUQjOk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043