UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MBvGE29Ik24pWndzaY5D8c+SP/ZPxFkMjK8bhKUgipw=' 
WHERE 
  key_id = '66e73ac5df142fd6e6bf36b1192554a364f547b8bc3fbff2eb7c4869f93f7e09' 
  AND (
    token = 'MBvGE29Ik24pWndzaY5D8c+SP/ZPxFkMjK8bhKUgipw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024