UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LGeb5x24QvQo1bH1s8dTH6BP2wiZMhBXB9FNQHxwFnM=' 
WHERE 
  key_id = 'e2439202165c7948457bb573be4330770bf341246a98ada2df41e504abb7a5a2' 
  AND (
    token = 'LGeb5x24QvQo1bH1s8dTH6BP2wiZMhBXB9FNQHxwFnM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026