UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'evbUp1ZVZSF5vJHxCpjvC0p2YCPFEwN/iK3NZmNuuWU=' 
WHERE 
  key_id = 'fcfb5d6f00ec9c6988febe957e9b057bc9a24a4598d87f2c3324188e640c220d' 
  AND (
    token = 'evbUp1ZVZSF5vJHxCpjvC0p2YCPFEwN/iK3NZmNuuWU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028