UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eYgXdkOkeczLp2ATIOfpHUVGFLbsdqO7BDA/2XJzLuI=' 
WHERE 
  key_id = '71e0c8f23c70c6b080d16cbd2acf0e861e1503a2145cdccd3d6bf945d99a36a9' 
  AND (
    token = 'eYgXdkOkeczLp2ATIOfpHUVGFLbsdqO7BDA/2XJzLuI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045