UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'c5CWzDQu00KIx2MlnJV+Xj0BfYJozKCdW8Ahk1Qsl6A=' 
WHERE 
  key_id = '7cd607ce31e9b343954536b57ecc4ebaa6dd40199db6913bfc0de9ed0038989d' 
  AND (
    token = 'c5CWzDQu00KIx2MlnJV+Xj0BfYJozKCdW8Ahk1Qsl6A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035