UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9/Zw/zChhhAn9A+dxEo5VDFdrXJgIBiHKpMMhIYH3FE=' 
WHERE 
  key_id = '5ed0fd63be2f64aeae4a8ed3d0a9a38575aa149daedff81b44e130c5d32d252f' 
  AND (
    token = '9/Zw/zChhhAn9A+dxEo5VDFdrXJgIBiHKpMMhIYH3FE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031