UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XbLLIHuLoMyxd9Ub4yUK9qnRIyCronjjwQGun4jDqBo=' 
WHERE 
  key_id = '4f61f108c7bf402d8c88362f49aaa3a6f26bbd66b96542aba45a62fa11dc2417' 
  AND (
    token = 'XbLLIHuLoMyxd9Ub4yUK9qnRIyCronjjwQGun4jDqBo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034