UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/aQB7dMKdQV6z+bh/3ZLnYsTiUkmQ9C1hfq0OqBW3/0=' 
WHERE 
  key_id = 'b2072744aaace1164be4b85b84bed8b16ade51e8a5d0e74e1f652a8be6107224' 
  AND (
    token = '/aQB7dMKdQV6z+bh/3ZLnYsTiUkmQ9C1hfq0OqBW3/0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027