UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ra4B7xYHv/QM7RgCMwktq5092MM+1BmsY2IgqELfdJU=' 
WHERE 
  key_id = 'cb80c94d2d2d8fc03aa13802e497ad62f45659fdd0df6a9d82169f2d99318d74' 
  AND (
    token = 'ra4B7xYHv/QM7RgCMwktq5092MM+1BmsY2IgqELfdJU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036