UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CuMR3UeqUdWmHbAtkIsaZJkMYtHA621W8bLKS/Gn1is=' 
WHERE 
  key_id = '39ede71ca7d2abae8e3fdf8aaa785ca80aa5cd15de6c24ecdf6e0aabf81fc0c9' 
  AND (
    token = 'CuMR3UeqUdWmHbAtkIsaZJkMYtHA621W8bLKS/Gn1is=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047