UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MBmBfF/tHS6SZHGQ2Bq2GkUreak1Y60+m2CFbEpVIQY=' 
WHERE 
  key_id = '6bfaffd26ea3ff7ccf76f7a4b8d914c73e71df25d6ae947f9be06183490342b0' 
  AND (
    token = 'MBmBfF/tHS6SZHGQ2Bq2GkUreak1Y60+m2CFbEpVIQY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042