UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PFDFc4pd8ze6njnRMxSK6uCc2xQZP+qfGPmV9UqQ3Cs=' 
WHERE 
  key_id = 'e373ec6ff34dd2e722b4218bb309290f781a0337c37e57e75a6c5f5a4d0904df' 
  AND (
    token = 'PFDFc4pd8ze6njnRMxSK6uCc2xQZP+qfGPmV9UqQ3Cs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037