UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7dNBqQgIHOMvSWMpdNc4o0jQNcaWsDA0oyIg0U+Qllk=' 
WHERE 
  key_id = '2466e0c077e0e63e63dc4d96865cd8780ef23f7093c6507e2ece8deb88c3ce1a' 
  AND (
    token = '7dNBqQgIHOMvSWMpdNc4o0jQNcaWsDA0oyIg0U+Qllk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028