UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rkBuZu5U3pA1wcR2IcIF/hBtRYDXMvz6ToMSvHkiJDI=' 
WHERE 
  key_id = 'e66aace95ea498705673da998ebe1e16d0a1e809a3073df4ec077f0f85de169e' 
  AND (
    token = 'rkBuZu5U3pA1wcR2IcIF/hBtRYDXMvz6ToMSvHkiJDI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035