UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VfQeqbd/XsCi9NHOTpUvQlpXFtT49Jrhc1DCjXxhBl8=' 
WHERE 
  key_id = 'bb144dadeab237babb7c218d9e2ba1bd468f077471d72f8cd7463f1c33840862' 
  AND (
    token = 'VfQeqbd/XsCi9NHOTpUvQlpXFtT49Jrhc1DCjXxhBl8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021