UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Xt5GxeKwN+tAS/VcijV5rwLmQIWo5qsuoshz4Hhnn7U=' 
WHERE 
  key_id = 'bbc119139b4d53bdbdb9d2a00fed431fb48ff9988287cba41c4ba9ea98ac98f2' 
  AND (
    token = 'Xt5GxeKwN+tAS/VcijV5rwLmQIWo5qsuoshz4Hhnn7U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045