UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Mg9IELPj5/bCjFAXuWjZAvSKK/N9eBRN66cw9pRUZms=' 
WHERE 
  key_id = 'db1974850ae05e7f2ecd68eef6f2a7e58fd72d524ed91ea7fdf7f3491df41ebc' 
  AND (
    token = 'Mg9IELPj5/bCjFAXuWjZAvSKK/N9eBRN66cw9pRUZms=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045