UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '57E5sJuefsQ7SD0UBugO5zc08m+Na63276sw3K/C5iU=' 
WHERE 
  key_id = '6716f893b87d4aa9100dd861376afedfe92bbf1c90ad204162cf37f7e267a5b0' 
  AND (
    token = '57E5sJuefsQ7SD0UBugO5zc08m+Na63276sw3K/C5iU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042